package com.glodon.paas.account.service;

import java.util.List;

import com.glodon.paas.account.api.bean.Member;
import com.glodon.paas.account.api.bean.Org;
import com.glodon.paas.exception.PaasException;
import com.glodon.paas.exception.PaasServerException;

public interface OrgService {

    void addOrg(Org org) throws PaasException;

    /**
     * get organization by id, with sub organizations and members
     * 
     * @param id organization id
     * @return
     */
    Org getOrg(String id);
    List<Org> getOrgAndMembers(String id);

    void deleteOrg(String id) throws PaasException;

    List<Org> getOrgs(String ownerId);

    /**
     * invite organization member by email or mobile phone number
     * 
     * @param orgId organization id
     * @param keys
     *      email or mobile phone number
     * @return invite code list
     * @throws PaasException duplicate invite member 
     */
    List<String> addMemeber(String orgId, String... keys) throws PaasServerException;

    void updateOrg(Org org);

    void removeMember(String orgId, String userId);

    boolean isMember(String userId, String orgId);

    List<Org> getSubOrgs(String id);

    void deleteOrg(String id, boolean force);

    void accept(String userId, String email, String inviteCode);

    Member getMember(String institutionId, String email);

    void sendInviteMail(Member member) throws PaasServerException;

}
